import Vue from 'vue'
import Vuex from 'vuex'
import vuexPersistedstate from 'vuex-persistedstate'   // Vuex 持久化
Vue.use(Vuex)

export default new Vuex.Store({
  plugins: [
    vuexPersistedstate()
  ],
  state: {
    vuexUserInfo: {},
    vuexPhone: '',
  },
  getters: {
    token: state => state.vuexUserInfo.token,
  },
  mutations: {
    setVuexUserInfo(state, userInfo) {
      state.vuexUserInfo = userInfo
    },
    setVuexPhone(state, vuexPhone) {
      state.vuexPhone = vuexPhone
    }
  },
  actions: {},
  modules: {}
})
